<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=393, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>收藏景区</title>
    <style>
        /* 设置页面固定宽高并禁止滚动 */
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            background-color: #f9f9f9;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            overflow: hidden; /* 防止页面滚动 */
        }

        .container {
            width: 393px;
            height: 853px;
            max-width: 100%;
            padding: 10px;
            box-sizing: border-box;
            background-color: #fff;
            border: 1px solid #ddd;
            border-radius: 8px;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
            display: flex;
            flex-direction: column;
        }

        .header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px;
            background-color: #ddd;
            border-bottom: 1px solid #ddd;
        }
        .header h1 {
            font-size: 18px;
            margin: 0;
            text-align: center;
        }
        .header button {
            padding: 8px 12px;
            border: none;
            background-color: #c1bebe;
            color: black;
            border-radius: 4px;
            cursor: pointer;
            font-size: 14px;
        }
        .header button:hover {
            background-color: #0056b3;
        }

        .spot-container {
            width: 100%;
            overflow-y: auto;
            flex-grow: 1; /* 允许内容区域扩展以填充剩余空间 */
            padding: 10px 0;
        }

        .spot {
            display: flex;
            flex-direction: column;
            border: 1px solid #ddd;
            border-radius: 8px;
            margin: 10px 10px 20px;
            padding: 10px;
            background: white;
            text-align: center;
            height: 200px;
            position: relative;
        }

        .spot img {
            width: 100%;
            height: 150px;
            object-fit: cover;
            border-radius: 8px 8px 0 0;
        }

        .spot h3 {
            margin: 10px 0;
            font-size: 16px;
        }

        .spot button {
            background-color: #007bff;
            color: white;
            border: none;
            padding: 10px;
            border-radius: 4px;
            cursor: pointer;
            position: absolute;
            bottom: 20px;
            right: 20px; /* 将按钮定位到右下角 */
            width: 80px;
        }

        .spot button:hover {
            background-color: #0056b3;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <h1>已收藏订单</h1>
            <button class="back-btn" onclick="window.location.href='/order'">返回</button>
        </div>
        <div class="spot-container">
            {% for spot in spots %}
            <div class="spot">
                <img src="{{ url_for('static', filename='images/' + spot.image_url) }}" alt="{{ spot.name }}">
                <h3>{{ spot.name }}</h3>
                <button onclick="window.location.href='/ticket_sure/{{ spot.id }}'">预定</button>
            </div>
            {% endfor %}
        </div>
    </div>
</body>
</html>
